﻿using System.Collections.Generic;
using System.Linq;

namespace tomenglertde.SetupProject.ViewModel
{
    public class SolutionViewModel
    {
        private readonly EnvDTE.Solution _solution;

        public SolutionViewModel(EnvDTE.Solution solution)
        {
            _solution = solution;
        }

        public IEnumerable<SetupProjectViewModel> SetupProjects
        {
            get
            {
                return Projects
                    .Where(p => p.Kind == @"{54435603-DBB4-11D2-8724-00A0C9A8B90C}")
                    .Select(p => new SetupProjectViewModel(_solution, p));
            }
        }

        public IEnumerable<EnvDTE.Project> Projects
        {
            get
            {
                return _solution.GetProjecs();
            }
        }
    }
}
